package dbgorm

import "gorm.io/gorm/logger"

// 设置输出的日志等级
//
//	level	设置grom的日志等级
func WithLog(level logger.LogLevel) Option {
	return func(c *OptionInfo) {
		c.LogLevel = int(level)
		c.Conf.Logger = logger.Default.LogMode(level)
	}
}

// 设置隐藏gorm的日志输出
func WithNoLog() Option {
	return func(c *OptionInfo) {
		c.LogLevel = 1
		c.Conf.Logger = logger.Default.LogMode(logger.Silent)
	}
}
